/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package modeles.beans;

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Fred
 */
@ManagedBean(name = "accueil")
@ViewScoped
public class AccueilBean implements Serializable {

    /**
     * Creates a new instance of AccueilBean
     */
    
    public AccueilBean() {        
    }

    public String getHeaderHtml() {
        Object loginBean = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("loginBean");
        if (loginBean != null) {
            if (((LoginBean) loginBean).isLoggedIn()) {
                return "Vous êtes connecté à la plate-forme AdminShopEasy !";
            }
        }
        return "<a href=\"pages/connexion.xhtml\" class=\"button\">Connexion</a>";
    }
}
